home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 175 (1991-09-10)(Manewaldt, A.)(DE)(PD).zip / Taifun 175 (1991-09-10)(Manewaldt, A.)(DE)(PD).adf / Term / Libs.LZH / XprXModem / libstart.asm < prev    next >
Assembly Source File  |  1991-07-26  |  2KB  |  95 lines

  1. ; Copyright (C) 1986,1987 by Manx Software Systems, Inc.
  2. ;
  3. ;:ts=8
  4.  
  5. ;    libstart.a68 -- romtag for library
  6.  
  7.     include    'exec/types.i'
  8.     include    'exec/resident.i'
  9.     include    'exec/nodes.i'
  10.     include    'exec/libraries.i'
  11.  
  12. MYVERSION    equ    34
  13. MYPRI        equ    0
  14.  
  15.     cseg    ; romtag must be in first hunk
  16.  
  17.     public    _myname
  18.     public    _myid
  19.     public    _myInitTab
  20.  
  21.     moveq    #-1,d0        ; don't let them run me
  22.     rts
  23.  
  24.     public    _myRomTag
  25. _myRomTag:
  26.     dc.w    RTC_MATCHWORD
  27.     dc.l    _myRomTag
  28.     dc.l    endtag
  29.     dc.b    RTF_AUTOINIT
  30.     dc.b    MYVERSION
  31.     dc.b    NT_LIBRARY
  32.     dc.b    MYPRI
  33.     dc.l    _myname
  34.     dc.l    _myid
  35.     dc.l    _myInitTab
  36. endtag:
  37.     dc.w    0        ;to get things aligned to 4 byte boundary
  38.  
  39.  
  40. ;    For libraries:
  41. ;        library base in D0
  42. ;        segment list in A0
  43. ;        execbase in A6
  44.  
  45. ;    Initial startup routine for Aztec C.
  46.  
  47. ;    NOTE: code down to "start" must be placed at beginning of
  48. ;        all programs linked with Aztec Linker using small
  49. ;        code or small data.
  50.  
  51.  
  52.     public    .begin
  53. .begin
  54.     public    _myInit
  55. _myInit:
  56.     movem.l    d0-d7/a0-a6,-(sp)    
  57.     movem.l    d0/a0,-(sp)        ;save library parameters
  58.     bsr    _geta4            ;get A4
  59.     lea    __H1_end,a1
  60.     lea    __H2_org,a0
  61.     cmp.l    a1,a0            ;check if BSS and DATA together
  62.     bne    start            ;no, don't have to clear
  63.     move.w    #((__H2_end-__H2_org)/4)-1,d1
  64.     bmi    start            ;skip if no bss
  65.     move.l    #0,d0
  66. loop
  67.     move.l    d0,(a1)+        ;clear out memory
  68.     dbra    d1,loop
  69.  
  70. start
  71.     move.l    a6,_SysBase        ;put where we can get it
  72.  
  73.     jsr    __main            ;call the startup stuff
  74. 4$
  75.     add.w    #8,sp            ;pop args
  76.     movem.l    (sp)+,d0-d7/a0-a6
  77.     rts                ;and return
  78.  
  79.     public    _geta4
  80.  
  81. _geta4:
  82.     far    data
  83.     lea    __H1_org+32766,a4
  84.     rts
  85.  
  86.     public    __main,__H0_org
  87.  
  88.     dseg
  89.  
  90.     public    _SysBase
  91.     public    __H1_org,__H1_end,__H2_org,__H2_end
  92.     bss    _SysBase,4
  93.  
  94.     end
  95.